﻿Imports System.Data.OleDb
Public Class Data_Provider
    Public Shared Function ConnecDTB() As OleDbConnection
        Dim connecstring As String
        connecstring = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =Database1.mdb"
        Dim connec As New OleDbConnection(connecstring)
        connec.Open()
        Return connec
    End Function
    Public Shared Sub DongKetNoi(ByVal ketnoi As OleDbConnection)
        If Not (ketnoi Is Nothing) AndAlso ketnoi.State = ConnectionState.Open Then
            ketnoi.Close()
        End If
    End Sub
End Class
